package com.dks.businessUtil;


import javax.annotation.PostConstruct;

import com.dks.mapper.QsMailMapper;
import com.dks.models.QsMail;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @Author: Ah Nan
 * @Description: 设置站内信
 * @Date: 14:40 2020/5/7
 * @Modificd By:
 * @Param:
 * @return:
 * @throw: 请描述异常信息
 */

@Component
public class QsMailUtil {

    @Autowired
    private QsMailMapper qsMailMapper;


    public static QsMailUtil qsMailUtil;

    public QsMailUtil() {

    }

    @PostConstruct
    public void init() {
        qsMailUtil = this;
        qsMailUtil.qsMailMapper = this.qsMailMapper;
    }

    /***
     * @Author: Ah Nam
     * @Description: 添加站内信 异步
     * @param
     */
    @Async("asyncServiceExecutor")
    public boolean insertQsMail(QsMail qsMail) {
        int row = qsMailUtil.qsMailMapper.insert(qsMail);
        return true;
    }
}
